home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
kernel
/
port
/
port.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-16
|
635b
|
36 lines
/* This file is used to help port the jumpto.s to a new platform */
#include <stdio.h>
char *obj = "Some object pointer";
char *GenObj = "Some Generic Object Pointer";
typedef int (*ofun)();
int Method(char *self, int a, int b, int c)
{
printf("Method reached with args %s %d %d %d\n", self, a, b, c);
return a + b + c;
}
ofun FindMethod(char *obj, char *gen)
{
return Method;
}
GenericFunction(char *self, ...)
{
_jumpToMethod( FindMethod(self, GenObj) );
}
main(void)
{
int r = GenericFunction(obj, 1, 2, 3);
printf("Value returned from GenericFunction = %d\n", r);
return 0;
}